package com.utf999.qiangmanger.dao.impl;

import java.util.HashMap;
import java.util.List;

import org.springframework.stereotype.Component;

import com.utf999.qiangmanger.dao.AbstractRelationalDBDAO;
import com.utf999.qiangmanger.dao.iface.IOrderTypeDefineDAO;
import com.utf999.qiangmanger.entity.orm.OrderTypeDefineEntity;
import com.utf999.qiangmanger.exception.BizException;

/**
 * @author yinwenjie
 */
@Component("OrderTypeDefineDAOImpl")
public class OrderTypeDefineDAOImpl extends AbstractRelationalDBDAO<OrderTypeDefineEntity> implements IOrderTypeDefineDAO {

	/* (non-Javadoc)
	 * @see com.utf999.qiangmanger.dao.AbstractRelationalDBDAO#getEntityClass()
	 */
	@Override
	protected Class<OrderTypeDefineEntity> getEntityClass() {
		return OrderTypeDefineEntity.class;
	}

	/* (non-Javadoc) 
	 * @see com.utf999.qiangmanger.dao.iface.IOrderTypeDefineDAO#queryOrderTypeDefine(java.lang.String)
	 */
	@Override
	public List<OrderTypeDefineEntity> queryOrderTypeDefine(String ordertypeid) throws BizException {
		HashMap<String, Object> condition = new HashMap<String, Object>();
		condition.put("ordertypeid", ordertypeid);
		//按照durationChange排序，非常有必要
		List<OrderTypeDefineEntity> defines = this.queryByHqlFile("IOrderTypeDefineDAO.queryOrderTypeDefine", condition);
		return defines;
	}
}